//  我的余额页面
//  BalanceViewController.m
//  GoBigMarket
//
//  Created by 李真 on 16/8/20.
//  Copyright © 2016年 legend. All rights reserved.
//

#import "BalanceViewController.h"
#import "BalanceTableViewCell.h"

@interface BalanceViewController ()

@end

@implementation BalanceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"我的余额";
    self.withdrawBtn.layer.masksToBounds = YES;
    self.withdrawBtn.layer.cornerRadius = 5;
    
    self.alphaView.layer.masksToBounds = YES;
    self.alphaView.layer.cornerRadius = 5;
    self.yuErLabel.text = _money;
    self.RMBLabel.right = self.yuErLabel.left;
    
}

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    self.yuErLabel.width = 20 * self.yuErLabel.text.length + 5;
    self.RMBLabel.left = self.yuErLabel.right;
}

-(void)setMoney:(NSString *)money{
    if (_money != money) {
        _money = money;
    }
}

#pragma mark - 提现按钮触发事件
- (IBAction)withdrawBtnAction:(id)sender {
    
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BalanceCell"];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"BalanceCell"];
    }
    cell.textLabel.text = [NSString stringWithFormat:@"%@",indexPath];
    return cell;
}
//头视图
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, XNWindowWidth, 44)];
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 2, XNWindowWidth, 30)];
    label.text = @"最近30天收支明细";
    label.textAlignment = NSTextAlignmentLeft;
    label.backgroundColor = [UIColor clearColor];
    view.backgroundColor = [UIColor lightGrayColor];
    [view addSubview:label];
    return view;
}
#pragma mark - UITableViewDelegate
//点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
}


@end
